home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / dblk2.zip / DBLKTEST.PAS < prev    next >
Pascal/Delphi Source File  |  1989-09-30  |  1KB  |  38 lines

  1. program dblktest;
  2. { just a test program to read a Dbase III + file, show the structure,
  3.   and optionally list the records in SDF format.
  4. }
  5. uses
  6.    crt,dblook;
  7.  
  8. var
  9.    infile    :string;
  10.    i         :integer;
  11.    ch        :char;
  12.  
  13. begin   { main }
  14.    clrscr;
  15.    writeln('Utility to read Dbase III+ .DBF files.         ',version_no);
  16.    writeln;
  17.    write('Enter Dbase file to read (END to exit) ');
  18.    readln(infile);
  19.    for i := 1 to length(infile) do infile[i] := upcase(infile[i]);
  20.    if (infile <> 'END') then
  21.       begin
  22.       if(dbuse(infile) = DBOK) then { open file, read the header of the database file }
  23.          begin
  24.          showstruc;           { show us what you have found }
  25.          write('Read and display the data (Y/N) ');
  26.          readln(ch);
  27.          ch := upcase(ch);
  28.          if ch = 'Y' then
  29.             list_all_recs;
  30.          if(dbclose <> DBOK) then
  31.             writeln('Unable to close ',infile);
  32.       end
  33.       else
  34.          writeln('Unable to open Dbase file ',infile);
  35.    end;
  36.    writeln('End of DBlook.');
  37. end.
  38.